package chapter11;

import java.util.LinkedList;
import java.util.Queue;

/**
 * Created by VIC on 2017/1/25.
 */
public class Test27 {
    class Command {
        private String str = "Stand";
        public void printCommand() {
            System.out.print(str);
        }
    }

    class Clazz1 {
        private Queue<Command> queue = new LinkedList<Command>();
        public Queue<Command> pushCommand(Command command) {
            queue.offer(command);
            return queue;
        }
    }

    class Clazz2 {
        public void execute(Queue<Command> queue) {
            if(queue.peek() != null) {
                queue.remove().printCommand();
            }
        }
    }
}
